package com.lzb.permanentcalendar.adapter;

import android.graphics.Color;
import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lzb.permanentcalendar.R;
import com.lzb.permanentcalendar.basic.ProviderMultiAdapter;
import com.othershe.calendarview.bean.JrBean;

public class HomeFestivalAdapter extends ProviderMultiAdapter<JrBean> {

    public HomeFestivalAdapter() {
        addItemProvider(new HomeFestivalProvider());
    }

    private class HomeFestivalProvider extends BaseItemProvider<JrBean> {
        @Override
        public int getItemViewType() {
            return ProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_home_festival;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, JrBean bean) {
            baseViewHolder.setText(R.id.tvHomeFestivalItemDay, bean.getDay() + "");
            baseViewHolder.setText(R.id.tvHomeFestivalItemMonth, bean.getMo() + getContext().getString(R.string.month));
            baseViewHolder.setText(R.id.tvHomeFestivalItemName, bean.getJrName());
            baseViewHolder.setText(R.id.tvHomeFestivalItemNum, " " + bean.getNum() + " ");
        }
    }

}
